import request from '@/utils/request'

export function loginAPI(data) {
  return request({
    url: '/sys/login',
    method: 'post',
    data
  })
}

export const getUserInfoApi = () => request.get('/sys/profile')

// 修改密码
export const updatePasswordApi = (data) => request({
  url: '/sys/user/updatePass',
  method: 'put',
  data
})

// 获取用户扫码登录的加密串 用来生成二维码
export const getQrcodeKeyAPI = () => request.get('/sys/qrcodeKey')

// 获取扫码状态 多种状态- 1 未扫码 但是加密串未超时 2 已扫码但是未登录 3 已扫码并点登录 4 加密串失效或不存在 5 扫码后用户取消登录
export const getQrCodeStateAPI = params => request.get('/sys/qrcodeState', { params })

// 更新头像
export const updateUserStaffPhotoAPI = data => request.put('/sys/updateStaffPhoto', data)

// 群发消息

// 群发通知接口
export const sendMultiMessageAPI = data => request.post('/sys/messageMuch', data)

// 获取用户消息
export const getUserMessageAPI = () => request.get('/sys/message')
// 删除用户信息
export const delUserMessageAPI = id => request.delete(`/sys/message/${id}`)
// 已读消息
export const updateUserMessageAPI = id => request.put(`/sys/message/${id}`)

